<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>江西博物馆余票通知</title>
    <style>
        body {
            font-family: 'Microsoft YaHei', Arial, sans-serif;
            line-height: 1.6;
            color: #333;
            max-width: 600px;
            margin: 0 auto;
            padding: 20px;
            background-color: #f5f5f5;
        }
        .container {
            background-color: #ffffff;
            padding: 30px;
            border-radius: 8px;
            box-shadow: 0 2px 10px rgba(0,0,0,0.1);
        }
        .header {
            text-align: center;
            border-bottom: 2px solid #FF6B35;
            padding-bottom: 20px;
            margin-bottom: 30px;
        }
        .header h1 {
            color: #FF6B35;
            margin: 0;
            font-size: 24px;
        }
        .header .icon {
            font-size: 48px;
            margin-bottom: 10px;
        }
        .alert-box {
            background-color: #fff3cd;
            border: 1px solid #ffeaa7;
            border-radius: 6px;
            padding: 15px;
            margin-bottom: 20px;
            text-align: center;
        }
        .alert-box .alert-text {
            color: #856404;
            font-size: 18px;
            font-weight: bold;
            margin: 0;
        }
        .content {
            margin-bottom: 30px;
        }
        .ticket-table {
            width: 100%;
            border-collapse: collapse;
            margin: 20px 0;
            background-color: #fff;
        }
        .ticket-table th,
        .ticket-table td {
            padding: 12px;
            text-align: left;
            border-bottom: 1px solid #ddd;
        }
        .ticket-table th {
            background-color: #f8f9fa;
            font-weight: bold;
            color: #495057;
        }
        .ticket-table tr:hover {
            background-color: #f5f5f5;
        }
        .available-count {
            color: #28a745;
            font-weight: bold;
            font-size: 16px;
        }
        .date-highlight {
            color: #FF6B35;
            font-weight: bold;
        }
        .info-section {
            background-color: #f8f9fa;
            padding: 15px;
            border-radius: 6px;
            margin: 20px 0;
        }
        .info-section h3 {
            margin-top: 0;
            color: #495057;
        }
        .footer {
            text-align: center;
            padding-top: 20px;
            border-top: 1px solid #ddd;
            color: #666;
            font-size: 14px;
        }
        .urgent-notice {
            background-color: #f8d7da;
            border: 1px solid #f5c6cb;
            color: #721c24;
            padding: 15px;
            border-radius: 6px;
            margin: 20px 0;
        }
        .btn {
            display: inline-block;
            padding: 10px 20px;
            background-color: #FF6B35;
            color: white;
            text-decoration: none;
            border-radius: 5px;
            margin: 10px 0;
        }
    </style>
</head>
<body>
    <div class="container">
        <div class="header">
            <div class="icon">🎫</div>
            <h1>江西博物馆余票通知</h1>
        </div>

        <div class="alert-box">
            <p class="alert-text">🎉 发现余票！共 {{ $totalAvailable }} 张</p>
        </div>

        <div class="content">
            <p>您好！</p>
            <p>系统检测到江西博物馆有余票可预订，详情如下：</p>

            <table class="ticket-table">
                <thead>
                    <tr>
                        <th>日期</th>
                        <th>时间段</th>
                        <th>余票数量</th>
                        <th>总票数</th>
                    </tr>
                </thead>
                <tbody>
                    @foreach($availableTickets as $ticket)
                    <tr>
                        <td class="date-highlight">{{ $ticket['date'] }}</td>
                        <td>{{ $ticket['time_slot'] }}</td>
                        <td class="available-count">{{ $ticket['available_count'] }}</td>
                        <td>{{ $ticket['total_count'] }}</td>
                    </tr>
                    @endforeach
                </tbody>
            </table>

            <div class="urgent-notice">
                <strong>⚠️ 温馨提示：</strong>
                <ul style="margin: 10px 0; padding-left: 20px;">
                    <li>余票数量有限，建议尽快预订</li>
                    <li>预订时间可能会有延迟，请以官网实际情况为准</li>
                    <li>请准备好相关证件信息进行预订</li>
                </ul>
            </div>

            <div style="text-align: center; margin: 30px 0;">
                <a href="https://ticket.jxmuseum.cn" class="btn">立即前往预订</a>
            </div>
        </div>

        <div class="info-section">
            <h3>📋 查询信息</h3>
            <p><strong>查询时间：</strong>{{ $queryTime }}</p>
            <p><strong>监控日期：</strong>2025-10-03, 2025-10-07</p>
            <p><strong>系统状态：</strong>自动监控中</p>
        </div>

        <div class="footer">
            <p>此邮件由系统自动发送，请勿回复</p>
            <p>如有疑问，请联系系统管理员</p>
            <p style="margin-top: 10px; color: #999;">
                {{ config('app.name', '记账助手') }} - 余票监控系统
            </p>
        </div>
    </div>
</body>
</html>